<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Trie: rtv::Trie&lt; T, V, Cmp, Items &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Trie
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><b>rtv</b>      </li>
      <li class="navelem"><a class="el" href="classrtv_1_1_trie.html">Trie</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">rtv::Trie&lt; T, V, Cmp, Items &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="rtv::Trie" -->
<p><a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> main class.  
 <a href="classrtv_1_1_trie.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="trie_8h_source.html">trie.h</a>&gt;</code></p>

<p><a href="classrtv_1_1_trie-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#ad3f623b4e11a37e1c2eb007696ae84cd">Trie</a> (const T &amp;<a class="el" href="classrtv_1_1_trie.html#a193ac85f06798e78576f5d1b49b56891">endSymbol</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">std::pair&lt; Iterator, bool &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#aa9e051ae8d75ad29548412074d33e07a">insert</a> (const T *key, V const &amp;value)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#ab1b2f24ac7981cef236b5c00314366f9">erase</a> (const T *key)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a56453752511af2396dba211d7b304cfd">erase</a> (Iterator pos)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const V *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#ada63d93630ac7ca4c4eb046f8e26424a">get</a> (const T *key) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a37f27dc4bdf4f18d8a484f348a1fdb93">get</a> (const T *key)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">V &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a0080b8c445c25251b0ba4a99d039bef6">operator[]</a> (const T *key)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#af673e2895cb16c69144f9fd1a284a7ce">hasKey</a> (const T *key) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#af52269f118a233aa902e7eaa165b5b30">empty</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a353b6353bcf7f3d8cea69f1999a857f3">size</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#ae7087baa9deea6e1192cd42c324ae36e">clear</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a695a6caef52055b86efad4f3277e61fe">startsWith</a> (const T *prefix)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ConstIterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a3a3559142b5bcbeae08af08df53c9925">startsWith</a> (const T *prefix) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">T&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a193ac85f06798e78576f5d1b49b56891">endSymbol</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#ae72e5f97be19cbb9fe5da0c7f37df787">begin</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">end</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">Iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#aff63a96092a71a856698faba94048080">find</a> (const T *key)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ConstIterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a576a35b9b7f8af09213102405f1209ba">find</a> (const T *key) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ConstIterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#a8b0ae159e91f48616f1a6e56630a35ef">begin</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">ConstIterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classrtv_1_1_trie.html#af962dc8339563647a22c12bf815f8623">end</a> () const </td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt;<br/>
class rtv::Trie&lt; T, V, Cmp, Items &gt;</h3>

<p><a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> main class. </p>
<dl class=""><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">T</td><td>Type for each element in the key </td></tr>
    <tr><td class="paramname">V</td><td>Type of the value that the key will be representing </td></tr>
    <tr><td class="paramname">Cmp</td><td>Comparison functor </td></tr>
    <tr><td class="paramname">Items</td><td>The data structure that represents each node in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a>. Items can be rtv::SetItems&lt;T, V, Cmp&gt; or rtv::VectorItems&lt;T, V, Cmp, Max&gt;, Max is the integer representing number of elements in each <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> node.</td></tr>
  </table>
  </dd>
</dl>
<h2><a class="anchor" id="usage_sec"></a>
Usage of the Trie</h2>
<h3><a class="anchor" id="usage_declaration"></a>
Declarating the Trie</h3>
<p>A <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> with key as chars and value as std::string can be declared as given below </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;trie.h&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string&gt;</a> dictionary(<span class="charliteral">&#39;$&#39;</span>);

     <span class="keywordflow">return</span> 0;
 }
</pre></div><h3><a class="anchor" id="usage_population"></a>
Populatiion and deletion from the Trie</h3>
<p><a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> can be populated by using the <a class="el" href="classrtv_1_1_trie.html#aa9e051ae8d75ad29548412074d33e07a">Trie::insert</a> method and element can be removed using <a class="el" href="classrtv_1_1_trie.html#ab1b2f24ac7981cef236b5c00314366f9">Trie::erase</a>. </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string&gt;</a> dictionary(<span class="charliteral">&#39;$&#39;</span>);

     <span class="comment">// adding key value pair to the Trie</span>
     <span class="keywordflow">if</span> (dictionary.insert(<span class="stringliteral">&quot;karma$&quot;</span>, <span class="stringliteral">&quot;Destiny or fate, following as effect from cause&quot;</span>).second) {
         std::cout &lt;&lt; <span class="stringliteral">&quot;added karma&quot;</span> &lt;&lt; std::endl;
     }

     <span class="comment">// removing key from the Trie</span>
     <span class="keywordflow">if</span> (dictionary.erase(<span class="stringliteral">&quot;karma$&quot;</span>)) {
         std::cout &lt;&lt; <span class="stringliteral">&quot;removed karma&quot;</span> &lt;&lt; std::endl;
     }

     <span class="keywordflow">return</span> 0;
 }
</pre></div> <h3><a class="anchor" id="usage_retrieval"></a>
Retrieval of Value</h3>
<p>Value for a key can be retrieved using <a class="el" href="classrtv_1_1_trie.html#ada63d93630ac7ca4c4eb046f8e26424a">Trie::get</a> method and the existence of the key can be tested using <a class="el" href="classrtv_1_1_trie.html#af673e2895cb16c69144f9fd1a284a7ce">Trie::hasKey</a> method. </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string&gt;</a> dictionary(<span class="charliteral">&#39;$&#39;</span>);

     dictionary.insert(<span class="stringliteral">&quot;karma$&quot;</span>, <span class="stringliteral">&quot;Destiny or fate, following as effect from cause&quot;</span>);

     <span class="keywordflow">if</span> (dictionary.hasKey(<span class="stringliteral">&quot;karma$&quot;</span>)) {
         std::cout &lt;&lt; <span class="stringliteral">&quot;key karma found&quot;</span> &lt;&lt; std::endl;
     }
     std::string * result = dictionary.get(<span class="stringliteral">&quot;karma$&quot;</span>);
     <span class="keywordflow">if</span> (result) {
         std::cout &lt;&lt; result-&gt;c_str() &lt;&lt; std::endl;
     }

     <span class="keywordflow">return</span> 0;
 }
</pre></div><h3><a class="anchor" id="usage_searching"></a>
Searching keys which have common prefix</h3>
<p>Keys which begins with a specific charactars can be retrieved using <a class="el" href="classrtv_1_1_trie.html#a695a6caef52055b86efad4f3277e61fe">Trie::startsWith</a> method </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>
<span class="preprocessor"> #include &lt;vector&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string&gt;</a> dictionary(<span class="charliteral">&#39;\0&#39;</span>);

     dictionary.insert(<span class="stringliteral">&quot;karma&quot;</span>, <span class="stringliteral">&quot;Destiny or fate, following as effect from cause&quot;</span>);
     rtv::Trie&lt;char, std::string&gt;::Iterator iter = dictionary.startsWith(<span class="stringliteral">&quot;kar&quot;</span>);

     <span class="keywordflow">for</span> (; iter != dictionary.<a class="code" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">end</a>(); ++iter) {
         std::cout &lt;&lt; iter-&gt;first &lt;&lt; <span class="stringliteral">&quot; : &quot;</span> &lt;&lt; iter-&gt;second-&gt;c_str() &lt;&lt; std::endl;
     }

     <span class="keywordflow">return</span> 0;
 }
</pre></div><h3><a class="anchor" id="usage_array_of_node"></a>
Trie with each Node as an array</h3>
<p>Here each node of the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> is an array. The advantage is that the searching of a symbol in the array takes O(1) time (is constant time). The disadvantage is that the array will have empty elements so the space used will more than actually required.</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>
<span class="preprocessor"> #include &lt;vector&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <span class="comment">// Here 256 is the size of array in each node</span>
     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string, std::less&lt;char&gt;</a>,
               <a class="code" href="classrtv_1_1_vector_items.html" title="Container representing each node in the Trie.">rtv::VectorItems&lt;char, std::string, std::less&lt;char&gt;</a>, 256&gt; &gt; dictionary(<span class="charliteral">&#39;$&#39;</span>);

     <span class="keywordflow">return</span> 0;
 }
</pre></div><h3><a class="anchor" id="usage_vector_item"></a>
Efficient use of Trie for alphabets</h3>
<p>Below example shows how to use <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> to operate on alphabets efficiently. Here <a class="el" href="classrtv_1_1_vector_items.html" title="Container representing each node in the Trie.">VectorItems</a> is used to store alphabets with size of 28 (26 alphabets + space + end symbol).</p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>
<span class="preprocessor"> #include &lt;vector&gt;</span>
<span class="preprocessor"> #include &lt;cctype&gt;</span>

 <span class="keyword">class </span>TrieCaseInsensitiveCompare
 {
 <span class="keyword">public</span>:
     <span class="keywordtype">bool</span> operator()(<span class="keywordtype">char</span> v1, <span class="keywordtype">char</span> v2) {
         <span class="keywordtype">int</span> i1 = std::tolower(v1);
         <span class="keywordtype">int</span> i2 = std::tolower(v2);
         <span class="keywordflow">return</span> i1 &lt; i2;
     }
 };

 <span class="comment">// key to vector index converter</span>
 <span class="comment">// case insensitive and includes alphabets, space and end symbol</span>
 <span class="keyword">class </span>AlphaToIndex
 {
 <span class="keyword">public</span>:
     <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> operator()(<span class="keyword">const</span> <span class="keywordtype">char</span> &amp; c)<span class="keyword"> const </span>{
         <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> index = 0;
         <span class="keywordflow">if</span> (c == <span class="charliteral">&#39; &#39;</span>) {
             index = 27;
         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (c &gt;= <span class="charliteral">&#39;A&#39;</span> &amp;&amp; c &lt;= <span class="charliteral">&#39;Z&#39;</span>) {
             index = c - <span class="charliteral">&#39;A&#39;</span> + 1;
         } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (c &gt;= <span class="charliteral">&#39;a&#39;</span> &amp;&amp; c &lt;= <span class="charliteral">&#39;z&#39;</span>) {
             index = c - <span class="charliteral">&#39;a&#39;</span> + 1;
         }
         <span class="keywordflow">return</span> index;
     }
 };

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie</a>&lt;char, std::string,
               TrieCaseInsensitiveCompare,
               <a class="code" href="classrtv_1_1_vector_items.html" title="Container representing each node in the Trie.">rtv::VectorItems&lt;char, std::string, TrieCaseInsensitiveCompare, 28, AlphaToIndex&gt;</a>
               &gt; dictionary(<span class="charliteral">&#39;\0&#39;</span>);

     <span class="comment">// adding key value pair to the Trie</span>
     <span class="keywordflow">if</span> (dictionary.insert(<span class="stringliteral">&quot;karma&quot;</span>, <span class="stringliteral">&quot;Destiny or fate, following as effect from cause&quot;</span>).second) {
         std::cout &lt;&lt; <span class="stringliteral">&quot;added karma&quot;</span> &lt;&lt; std::endl;
     }

     <span class="comment">// removing key from the Trie</span>
     <span class="keywordflow">if</span> (dictionary.erase(<span class="stringliteral">&quot;karma&quot;</span>)) {
         std::cout &lt;&lt; <span class="stringliteral">&quot;removed karma&quot;</span> &lt;&lt; std::endl;
     }

     <span class="keywordflow">return</span> 0;
 }
</pre></div><h3><a class="anchor" id="usage_set_of_node"></a>
Trie with each Node as a set</h3>
<p>Here each node will be an ordered set. Here there will be no extra usage of space but search for a symbol in the node takes logarithmic time. <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> with this feature can also be used for caseinsensitive symbol handling. </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>
<span class="preprocessor"> #include &lt;set&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string, std::less&lt;char&gt;</a>,
               <a class="code" href="classrtv_1_1_set_items.html" title="Container representing each node in the Trie.">rtv::SetItems&lt;char, std::string, std::less&lt;char&gt;</a> &gt; &gt; dictionary(<span class="charliteral">&#39;$&#39;</span>);

     <span class="keywordflow">return</span> 0;
 }
</pre></div> <h3><a class="anchor" id="usage_iterator"></a>
Using Trie::Iterator</h3>
<p><a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> iterator can be used the same way as STL iterator. Key and value can be accessed from iterator using first and secod member. first is vector of key characters and second is a pointer to the value. </p>
<div class="fragment"><pre class="fragment"><span class="preprocessor"> #include &lt;trie.h&gt;</span>
<span class="preprocessor"> #include &lt;string&gt;</span>
<span class="preprocessor"> #include &lt;iostream&gt;</span>
<span class="preprocessor"> #include &lt;vector&gt;</span>

 <span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> ** argv) {

     <a class="code" href="classrtv_1_1_trie.html" title="Trie main class.">rtv::Trie&lt;char, std::string&gt;</a> dictionary(<span class="charliteral">&#39;\0&#39;</span>);

     dictionary.insert(<span class="stringliteral">&quot;karma$&quot;</span>, <span class="stringliteral">&quot;Destiny or fate, following as effect from cause&quot;</span>);

     rtv::Trie&lt;char, std::string&gt;::Iterator iter = dictionary.<a class="code" href="classrtv_1_1_trie.html#ae72e5f97be19cbb9fe5da0c7f37df787">begin</a>();
     rtv::Trie&lt;char, std::string&gt;::Iterator iend = dictionary.end();

     <span class="keywordflow">for</span> (; iter != iend; ++iter) {

         std::cout &lt;&lt; iter-&gt;first  &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; iter-&gt;second-&gt;c_str() &lt;&lt; std::endl;
     }

     <span class="keywordflow">return</span> 0;
 }
</pre></div> <dl><dt><b>Examples: </b></dt><dd><a class="el" href="array_node_8cpp-example.html#_a0">array_node.cpp</a>, <a class="el" href="common_prefix_8cpp-example.html#_a0">common_prefix.cpp</a>, <a class="el" href="insert_erase_8cpp-example.html#_a0">insert_erase.cpp</a>, <a class="el" href="iterators_8cpp-example.html#_a0">iterators.cpp</a>, <a class="el" href="retrieval_8cpp-example.html#_a0">retrieval.cpp</a>, and <a class="el" href="trie_interactive_8cpp-example.html#_a0">trie_interactive.cpp</a>.</dd>
</dl></div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad3f623b4e11a37e1c2eb007696ae84cd"></a><!-- doxytag: member="rtv::Trie::Trie" ref="ad3f623b4e11a37e1c2eb007696ae84cd" args="(const T &amp;endSymbol)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html">Trie</a> </td>
          <td>(</td>
          <td class="paramtype">const T &amp;&#160;</td>
          <td class="paramname"><em>endSymbol</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">endSymbol</td><td>The symbol which marks the end of key input </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ae72e5f97be19cbb9fe5da0c7f37df787"></a><!-- doxytag: member="rtv::Trie::begin" ref="ae72e5f97be19cbb9fe5da0c7f37df787" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Iterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ae72e5f97be19cbb9fe5da0c7f37df787">begin</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an iterator referring to the first element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An iterator to the first element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a8b0ae159e91f48616f1a6e56630a35ef"></a><!-- doxytag: member="rtv::Trie::begin" ref="a8b0ae159e91f48616f1a6e56630a35ef" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">ConstIterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ae72e5f97be19cbb9fe5da0c7f37df787">begin</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an constant iterator referring to the first element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An constant iterator to the first element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ae7087baa9deea6e1192cd42c324ae36e"></a><!-- doxytag: member="rtv::Trie::clear" ref="ae7087baa9deea6e1192cd42c324ae36e" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ae7087baa9deea6e1192cd42c324ae36e">clear</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>All the elements in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> are dropped, leaving the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> with a size of 0. </p>

</div>
</div>
<a class="anchor" id="af52269f118a233aa902e7eaa165b5b30"></a><!-- doxytag: member="rtv::Trie::empty" ref="af52269f118a233aa902e7eaa165b5b30" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#af52269f118a233aa902e7eaa165b5b30">empty</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Test whether <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> is empty </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> size is 0, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a3bfd08ed64b9fffbb6ff18d3bbd5ff00"></a><!-- doxytag: member="rtv::Trie::end" ref="a3bfd08ed64b9fffbb6ff18d3bbd5ff00" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Iterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">end</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an iterator referring to the past-the-end element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An iterator to the element past the end of the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </dd></dl>

</div>
</div>
<a class="anchor" id="af962dc8339563647a22c12bf815f8623"></a><!-- doxytag: member="rtv::Trie::end" ref="af962dc8339563647a22c12bf815f8623" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">ConstIterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">end</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns an constant iterator referring to the past-the-end element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>An constant iterator to the element past the end of the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a193ac85f06798e78576f5d1b49b56891"></a><!-- doxytag: member="rtv::Trie::endSymbol" ref="a193ac85f06798e78576f5d1b49b56891" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a193ac85f06798e78576f5d1b49b56891">endSymbol</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves the end symbol </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>end symbol </dd></dl>

</div>
</div>
<a class="anchor" id="ab1b2f24ac7981cef236b5c00314366f9"></a><!-- doxytag: member="rtv::Trie::erase" ref="ab1b2f24ac7981cef236b5c00314366f9" args="(const T *key)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ab1b2f24ac7981cef236b5c00314366f9">erase</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Remove the entry with the given key from the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key which should be erased, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the given key is erased from the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a>, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a56453752511af2396dba211d7b304cfd"></a><!-- doxytag: member="rtv::Trie::erase" ref="a56453752511af2396dba211d7b304cfd" args="(Iterator pos)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ab1b2f24ac7981cef236b5c00314366f9">erase</a> </td>
          <td>(</td>
          <td class="paramtype">Iterator&#160;</td>
          <td class="paramname"><em>pos</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Remove the entry with the given key from the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">pos</td><td>Iterator pointing to a single element to be removed from the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the given key is erased form the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a>, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="aff63a96092a71a856698faba94048080"></a><!-- doxytag: member="rtv::Trie::find" ref="aff63a96092a71a856698faba94048080" args="(const T *key)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Iterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#aff63a96092a71a856698faba94048080">find</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Searches the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> for an element with 'key' as key </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Iterator to the element with key 'key' if found, otherwise an Iterator to <a class="el" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">Trie::end</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a576a35b9b7f8af09213102405f1209ba"></a><!-- doxytag: member="rtv::Trie::find" ref="a576a35b9b7f8af09213102405f1209ba" args="(const T *key) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">ConstIterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#aff63a96092a71a856698faba94048080">find</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Searches the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> for an element with 'key' as key </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>ConstIterator to the element with key 'key' if found, otherwise an ConstIterator to <a class="el" href="classrtv_1_1_trie.html#a3bfd08ed64b9fffbb6ff18d3bbd5ff00">Trie::end</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ada63d93630ac7ca4c4eb046f8e26424a"></a><!-- doxytag: member="rtv::Trie::get" ref="ada63d93630ac7ca4c4eb046f8e26424a" args="(const T *key) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const V* <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ada63d93630ac7ca4c4eb046f8e26424a">get</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves the value for the given key </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Constant pointer to value for the given key, 0 on failure </dd></dl>

</div>
</div>
<a class="anchor" id="a37f27dc4bdf4f18d8a484f348a1fdb93"></a><!-- doxytag: member="rtv::Trie::get" ref="a37f27dc4bdf4f18d8a484f348a1fdb93" args="(const T *key)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V* <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#ada63d93630ac7ca4c4eb046f8e26424a">get</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves the value for the given key </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to value for the given key, 0 on failure </dd></dl>

</div>
</div>
<a class="anchor" id="af673e2895cb16c69144f9fd1a284a7ce"></a><!-- doxytag: member="rtv::Trie::hasKey" ref="af673e2895cb16c69144f9fd1a284a7ce" args="(const T *key) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#af673e2895cb16c69144f9fd1a284a7ce">hasKey</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Checks whether the given key is present in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>true if the key is present </dd></dl>

</div>
</div>
<a class="anchor" id="aa9e051ae8d75ad29548412074d33e07a"></a><!-- doxytag: member="rtv::Trie::insert" ref="aa9e051ae8d75ad29548412074d33e07a" args="(const T *key, V const &amp;value)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">std::pair&lt;Iterator, bool&gt; <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#aa9e051ae8d75ad29548412074d33e07a">insert</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">V const &amp;&#160;</td>
          <td class="paramname"><em>value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Add a key with value in to the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key which should be inserted, should be terminated by 'end' symbol </td></tr>
    <tr><td class="paramname">value</td><td>The value that is to be set with the key </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>An std::pair with pair::first set to the Iterator points to the element and pair::second to true is key is newly inserted, false otherwise </dd></dl>

</div>
</div>
<a class="anchor" id="a0080b8c445c25251b0ba4a99d039bef6"></a><!-- doxytag: member="rtv::Trie::operator[]" ref="a0080b8c445c25251b0ba4a99d039bef6" args="(const T *key)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">V&amp; <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>key</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves the value for the given key, If key does not match the key of any element in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a>, the function inserts a new element with that key and returns a reference to its mapped value </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">key</td><td>Key to be searched for, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Reference to value for the given key </dd></dl>

</div>
</div>
<a class="anchor" id="a353b6353bcf7f3d8cea69f1999a857f3"></a><!-- doxytag: member="rtv::Trie::size" ref="a353b6353bcf7f3d8cea69f1999a857f3" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">unsigned int <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a353b6353bcf7f3d8cea69f1999a857f3">size</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of elements in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>Number of key value pair in the <a class="el" href="classrtv_1_1_trie.html" title="Trie main class.">Trie</a> </dd></dl>

</div>
</div>
<a class="anchor" id="a695a6caef52055b86efad4f3277e61fe"></a><!-- doxytag: member="rtv::Trie::startsWith" ref="a695a6caef52055b86efad4f3277e61fe" args="(const T *prefix)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">Iterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a695a6caef52055b86efad4f3277e61fe">startsWith</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>prefix</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves Iterator to the elements with common prefix </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">prefix</td><td>Part of the key which should be searched, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Iterator to the elements with prefix specified in 'prefix' </dd></dl>

</div>
</div>
<a class="anchor" id="a3a3559142b5bcbeae08af08df53c9925"></a><!-- doxytag: member="rtv::Trie::startsWith" ref="a3a3559142b5bcbeae08af08df53c9925" args="(const T *prefix) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T, typename V, typename Cmp = std::less&lt;T&gt;, typename Items = SetItems&lt;T, V, Cmp&gt;&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">ConstIterator <a class="el" href="classrtv_1_1_trie.html">rtv::Trie</a>&lt; T, V, Cmp, Items &gt;::<a class="el" href="classrtv_1_1_trie.html#a695a6caef52055b86efad4f3277e61fe">startsWith</a> </td>
          <td>(</td>
          <td class="paramtype">const T *&#160;</td>
          <td class="paramname"><em>prefix</em></td><td>)</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Retrieves ConstIterator to the elements with common prefix </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">prefix</td><td>Part of the key which should be searched, should be terminated by 'end' symbol </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>ConstIterator to the elements with prefix specified in 'prefix' </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="trie_8h_source.html">trie.h</a></li>
</ul>
</div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Thu Jun 21 2012 20:18:39 for Trie by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
